package com.example.demo.service;

import com.example.demo.mapper.ProblemMapper;
import com.example.demo.model.Problem;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2022-09-19
 * Time:23:32
 */
@Service
public class ProblemService {
    @Autowired
    private ProblemMapper problemMapper;
//    获取题目列表
    public List<Problem> selectAll(){
       return problemMapper.selectAll();
    }

//    获取题目详情
    public Problem selectOne(Integer id){
       return problemMapper.selectOne(id);
//        return problemJson;
    }
//    新增题目
    public int insert(Problem problem){
        return problemMapper.insert(problem);
    }
//删除题目
    public int deleteProblem(Integer id){
        return problemMapper.delete(id);
    }


}
